package com.wu.apiorderaddfeign.service.impl;


import com.wu.apiorderaddfeign.service.Feign.OrderAddClient;
import com.wu.apiorderaddfeign.service.OrederService;
import com.wu.beans.Oreders;
import com.wu.vo.Reultvo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;

@Service
public class OrederServiceImpl implements OrederService {


    @Autowired
    private OrderAddClient orderAddClient;

    @Override
    public Reultvo save(Oreders oreders) {
        //1. 调⽤ order-add服务进⾏保存

        Reultvo  vo = orderAddClient.addOrder(oreders,"测试字符串");
        Oreders oreders1 = orderAddClient.addOrder("订单编号1111");
        System.out.println(oreders1);

        //2. 调⽤ orderitem-add 保存订单快照

        //3. 调⽤ stock-update 修改商品库存

        //4. 调⽤ shopcart-del 删除购物⻋记录
        return vo;
    }


}
